package com.bishe.demo.modules.tourism.dao;

import com.bishe.demo.modules.tourism.entity.Supplier;
import org.apache.ibatis.annotations.*;
import org.springframework.stereotype.Repository;

/**
 * @Description SupplierDao
 * @Author Lubb
 * @Date 2021/3/29 14:50
 */
@Repository
@Mapper
public interface SupplierDao {
    @Insert("insert into tourism_supplier(tel,name,city,imag_id) values(#{tel},#{name},#{city},#{imageId})")
    @Options(useGeneratedKeys = true, keyColumn = "id", keyProperty = "id")
    void addSupplier(Supplier supplier);

    @Delete("delete from tourism_supplier where id = #{id}")
    void deleteSupplierById(Integer id);

    @Update("update tourism_supplier set tel=#{tel},name=#{name},city=#{city},imag_id=#{imagId}")
    void updateSupplier(Supplier supplier);

    @Select("select * from tourism_supplier where id = #{id}")
    Supplier getSupplierById(Integer id);
}
